# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-osmgpsmap
_pkgname=osm-gps-map
pkgver=0.7.3
pkgrel=7
pkgdesc='Python bindings for osm-gps-map.'
arch=('x86_64' 'aarch64')
url='http://nzjrs.github.com/osm-gps-map/'
license=('GPL')
depends=('python2' 'python2-gobject2' 'pygtk' 'osm-gps-map')
makedepends=('python2-setuptools' 'gtk-doc')
source=("https://github.com/nzjrs/osm-gps-map/archive/$pkgver.tar.gz")
sha512sums=('853f57de94aa8a810449fc6e344d2ce13d35563e0e09f599c3f6c9ed8b70d918107e88febeeb2ccfd29de68a315d100a7ca19da0d242ba3fb4b54d55e2b70724')

build() {
  cd "$_pkgname-$pkgver/python"

  CFLAGS="-I/usr/include/pygtk-2.0/ -I/usr/include/glib-2.0/ "
  CFLAGS="$CFLAGS -I/usr/lib/glib-2.0/include/ -I/usr/include/osmgpsmap-1.0/"
  CFLAGS="$CFLAGS -I/usr/include/gtk-3.0/ -I/usr/include/pango-1.0/"
  CFLAGS="$CFLAGS -I/usr/include/harfbuzz/ -I/usr/include/cairo/"
  CFLAGS="$CFLAGS -I/usr/include/gdk-pixbuf-2.0/ -I/usr/include/atk-1.0/"
  export CFLAGS

  python2 setup.py build
}

package_python2-osmgpsmap() {

  cd "$_pkgname-$pkgver/python"

  python2 python/setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

